package com.hongye.manager.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hongye.common.response.ResponseResult;
import com.hongye.manager.service.FlowService;
import com.hongye.manager.vo.FlowVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@RestController
@RequestMapping("/flow")
public class FlowController {

    @Autowired
    private FlowService service;

    @RequestMapping("/getAll/{page}/{size}")
    public ResponseResult getAll(@PathVariable Integer page, @PathVariable Integer size){
        HashMap<String, Object> map = new HashMap<>();
        Page<FlowVo> all = service.getAll(new Page<>(page, size));
        map.put("data",all);
        return ResponseResult.ok(1,"成功",map);
    }
}
